package com.mgear.ldap.service;

import java.rmi.RemoteException;

import net.sf.json.JSONObject;

public class Test {

	public static void main(String[] args) throws RemoteException {

		String ujson = "{'userId':'310109197302274013','isQueryRoles':'1','isQueryorgs':'1','isQueryDepts':'0','pageSize':'10','currentPage':'1'}";
		
		LDAPDataServiceProxy lsp = new LDAPDataServiceProxy();
		
		String json = "{'userId':'310109197302274013'}";
		String jjson=lsp.userQueryServices_userQueryRoles(json);
		JSONObject json1=JSONObject.fromObject(jjson);
		
		
	  String json3=  json1.getJSONObject("datas").getJSONObject("table").toString();
		
		
		JSONObject js = JSONObject.fromObject(json3);
		System.out.println(json3+"++++++++++++++++++++____");
		
		
		String udjson = lsp.userQueryServices_userQuery4Detail(ujson);
		System.out.println(udjson);
		
		JSONObject jobj=JSONObject.fromObject(udjson);
		String userCn = jobj.getJSONObject("datas").getJSONObject("table").getJSONObject("row").getString("userName");
		String orgName = jobj.getJSONObject("datas").getJSONObject("table").getJSONObject("row").getString("orgName");
		String orgCode = jobj.getJSONObject("datas").getJSONObject("table").getJSONObject("row").getString("organizations");
		System.out.println(userCn+","+orgName+","+orgCode);
	}

}
